<?
require("config.php");

$location_status .= " | Edit";

$show_backnav = "menu";

require($rela_path . "bin/country.php");

$menutype = 2;

if (NULL!=$action){


   $field = array(
	"code",
	"contact_date",
	"name",
	"phone",
	"fax",
	"email",
	"city",
	"country",
	"trainer",
	"booking_time",
	"via",
	"coaching_type",
	"message",
	"status","last_name",
"company",
"profession",
"address",
"education",
"language",
	);

   $content = array(
	$Code,
    "$Year-$Month-$Day",
	$Name,
	$Phone,
	$Fax,
	$Email,
	$City,
	$Country,
	$Trainer,
	"$myYear-$myMonth-$myDay $myTime",
	$Via,
	$Coaching_type,
	$Message,
	$Status,$last_name,
$company,
$profession,
$address,
$education,
$language,
	);

   $exp = "id='$id'";

   myUpdate($table,$field,$content,$exp);


   header("location:" . $rela_path . "share/msg.php?v=732&Start_Num=" . $Start_Num);

   exit();

}


$Query = "select 
	code,
	contact_date,
	name,
	phone,
	fax,
	email,
	city,
	country,
	trainer,
	booking_time,
	via,
	coaching_type,
	message,
	payment,
	status,last_name,
company,
profession,
address,
education,
language 
from $table where id='$id' Limit 1";
$r = myQuery($Query);


	$Code=$r[0][0];
	$Contact_Date=$r[0][1];
	$Name=$r[0][2];
	$Phone=$r[0][3];
	$Fax=$r[0][4];
	$Email=$r[0][5];
	$City=$r[0][6];
	$Country=$r[0][7];
	$Trainer=$r[0][8];
	$BookingTime=$r[0][9];
	$Via=$r[0][10];
	$Coaching_type=$r[0][11];
	$Message=$r[0][12];
	$Payment=$r[0][13];
	$Status=$r[0][14];
$last_name=$r[0][15];
$company=$r[0][16];
$profession=$r[0][17];
$address=$r[0][18];
$education=$r[0][19];
$language=$r[0][20];

require($rela_path . "inc/header.php");
require($rela_path . "bin/date.php");

?>

<form action="" method="post" enctype="multipart/form-data" name="form1">
<!--hidden filed-->
<input name="action" type="hidden" value="edit">
<input name="Code" type="hidden" value="<?print($Code)?>">

<input name="old_Picture_sm" type="hidden" value="<?print($Picture_sm)?>">
<input name="old_Picture" type="hidden" value="<?print($Picture)?>">

  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image" type="image" onclick="Redirect('menu.php',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image" type="image" src="../../images/bt_save.gif" width="76" height="22"  <?print($active)?>> 
      </td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right">&nbsp; </td>
    </tr>
    <tr> 
      <td><table border="0">
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr> 
            <td class="tdheader">Booking No. :</td>
            <td> <?print($Code)?> </td>
          </tr>
          <tr> 
            <td class="tdheader">Status :</td>
            <td>
			
<?
$sourceData = array(

"0",
"1",
"2",
"3",
"4",
"5",
"6",

);


$sourceLabel = array(

"Non-paid",
"Paid by PayPal",
"Paid",
"Coach has contacted client",
"In coaching",
"Cancelled",
"Finished",

);

FFPSelectBox("Status",$Status,$sourceData,$sourceLabel);

?></td>
          </tr>


          <tr> 
            <td class="tdheader">Contact Date :</td>
            <td><?print(FFPdate($Contact_Date))?></td>
          </tr>
          <tr>
            <td class="tdheader">First Name :</td>
            <td><input class="text" name="Name" type="text" size="30" value="<?echo $Name?>" /></td>
          </tr>
          <tr>
            <td class="tdheader">Family Name : </td>
            <td><input name="last_name" type="text" class="text" id="last_name" value="<?=$last_name?>" size="30" /></td>
          </tr>
          <tr>
            <td class="tdheader">Email :</td>
            <td><input class="text" name="Email" type="text" size="40" value="<?echo $Email?>" /></td>
          </tr>
          <tr>
            <td class="tdheader">Mobile :</td>
            <td><input class="text" name="Phone" type="text" size="30" value="<?echo $Phone?>" /></td>
          </tr>
          <tr>
            <td class="tdheader">Company : </td>
            <td><input name="company" type="text" class="text" id="company" value="<?=$company?>" size="30" /></td>
          </tr>
          <tr>
            <td class="tdheader">Title / Profession :</td>
            <td><input name="profession" type="text" class="text" id="profession" value="<?=$profession?>" size="30" /></td>
          </tr>
          <tr>
            <td class="tdheader">Company phone  :</td>
            <td><input class="text" name="Fax" type="text" size="30" value="<?echo $Fax?>" /></td>
          </tr>
          <tr>
            <td class="tdheader">Address :</td>
            <td><textarea name="address" cols="40" rows="4" class="text" id="address"><?=$address?>
            </textarea></td>
          </tr>
          <tr>
            <td class="tdheader">Education :</td>
            <td><input name="education" type="text" class="text" id="education" value="<?=$education?>" size="30" /></td>
          </tr>
          <tr>
            <td class="tdheader">Language :</td>
            <td><input name="language" type="text" class="text" id="language" value="<?=$language?>" size="30" /></td>
          </tr>
          <tr>
            <td class="tdheader">City :</td>
            <td><input class="text" name="City" type="text" size="30" value="<?echo $City?>" /></td>
          </tr>
          <tr>
            <td class="tdheader">Country :</td>
            <td><?print(FFPCountry($Country))?></td>
          </tr>
          <tr> 
            <td class="tdheader">Trainer selected :</td>
            <td> 
<?

$Query = "select name from course_trainer_info";
$r = myQuery($Query);

$sourceData = array();
$sourceLabel = $sourceData;

for ($i=0;$i<count($r);$i++){

	array_push($sourceData,$r[$i][0]);

	}


FFPSelectBox("Trainer",$Trainer,$sourceData,$sourceLabel);

?>            </td>
          </tr>
          <tr> 
            <td class="tdheader">Booking Time :</td>
            <td><?print(FFPtime1($BookingTime))?></td>
          </tr>


          <tr> 
            <td class="tdheader">Coaching via</td>
            <td> 
<?
		



$sourceData = array(
	"Interview",
	"Phone",
	"Instant Messaging"
	);

$sourceLabel=$sourceData ;
$boxName = "Via";

$value=$Via;

FFPCheckBox($boxName,$value,$sourceData,$sourceLabel)

?>			  </td>
          </tr>




          <tr> 
            <td class="tdheader">Coaching Type :</td>
            <td> 

<?
$Query="select 
	  code,
	  content,
	  testimonial,
	  publish,
	  description1,
	  currency1,
	  fee1,
	  publish1,
	  description2,
	  currency2,
	  fee2,
	  publish2,
	  description3,
	  currency3,
	  fee3,
	  publish3,
	  description4,
	  currency4,
	  fee4,
	  publish4,
	  description5,
	  currency5,
	  fee5,
	  publish5,
	  description6,
	  currency6,
	  fee6,
	  publish6,
	  description7,
	  currency7,
	  fee7,
	  publish7,
	  description8,
	  currency8,
	  fee8,
	  publish8,
	  description9,
	  currency9,
	  fee9,
	  publish9,
	  description10,
	  currency10,
	  fee10,
	  publish10 
from course_coach_booking_content limit 1";
$r=myQuery($Query);

		$Code=$r[0][0];
		$Content=$r[0][1];
		$Testimonial=$r[0][2];
		$Publish=$r[0][3];
		$Description1=$r[0][4];
		$Currency1=$r[0][5];
		$Fee1=$r[0][6];
		$Publish1=$r[0][7];
		$Description2=$r[0][8];
		$Currency2=$r[0][9];
		$Fee2=$r[0][10];
		$Publish2=$r[0][11];
		$Description3=$r[0][12];
		$Currency3=$r[0][13];
		$Fee3=$r[0][14];
		$Publish3=$r[0][15];
		$Description4=$r[0][16];
		$Currency4=$r[0][17];
		$Fee4=$r[0][18];
		$Publish4=$r[0][19];
		$Description5=$r[0][20];
		$Currency5=$r[0][21];
		$Fee5=$r[0][22];
		$Publish5=$r[0][23];
		$Description6=$r[0][24];
		$Currency6=$r[0][25];
		$Fee6=$r[0][26];
		$Publish6=$r[0][27];
		$Description7=$r[0][28];
		$Currency7=$r[0][29];
		$Fee7=$r[0][30];
		$Publish7=$r[0][31];
		$Description8=$r[0][32];
		$Currency8=$r[0][33];
		$Fee8=$r[0][34];
		$Publish8=$r[0][35];
		$Description9=$r[0][36];
		$Currency9=$r[0][37];
		$Fee9=$r[0][38];
		$Publish9=$r[0][39];
		$Description10=$r[0][40];
		$Currency10=$r[0][41];
		$Fee10=$r[0][42];
		$Publish10=$r[0][43];
		

$sourceLabel = array(
	$Description1 . " fee " . $Currency1 . $Fee1 . "<BR>",
	$Description2 . " fee " . $Currency2 . $Fee2 . "<BR>",
	$Description3 . " fee " . $Currency3 . $Fee3 . "<BR>",
	$Description4 . " fee " . $Currency4 . $Fee4 . "<BR>",
	$Description5 . " fee " . $Currency5 . $Fee5 . "<BR>",
	$Description6 . " fee " . $Currency6 . $Fee6 . "<BR>",
	$Description7 . " fee " . $Currency7 . $Fee7 . "<BR>",
	$Description8 . " fee " . $Currency8 . $Fee8 . "<BR>",
	$Description9 . " fee " . $Currency9 . $Fee9 . "<BR>",
	$Description10 . " fee " . $Currency10 . $Fee10 . "<BR>",
);

$sourceData = array(
	"1",
	"2",
	"3",
	"4",
	"5",
	"6",
	"7",
	"8",
	"9",
	"10"
);


$boxName = "Coaching_type";

$value=$Coaching_type;

FFPCheckBox($boxName,$value,$sourceData,$sourceLabel)

?>			  </td>
          </tr>



          <tr> 
            <td class="tdheader">Message :</td>
            <td><textarea class="text" name="Message" cols="60" rows="12"><?echo $Message?></textarea></td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image2" type="image" onclick="Redirect('menu.php',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image2" type="image" src="../../images/bt_save.gif" width="76" height="22" <?print($active)?>> 
      </td>
    </tr>
  </table>
</form>
<?
require($rela_path . "inc/footer.php");
?>

